package mobi.pooper.pictures;

public class Picture {
	private final String name;
	private final String description;
	private int successesNumber;
	private int failsNumber;
	private int rowId;

	public Picture(String name, String description, int successesNumber, int failsNumber) {
		super();
		this.name = name;
		this.description = description;
		this.successesNumber = successesNumber;
		this.failsNumber = failsNumber;
	}

	public String getName() {
		return name;
	}

	public String getDescription() {
		return description;
	}

	public int getSuccessesNumber() {
		return successesNumber;
	}

	public int getFailsNumber() {
		return failsNumber;
	}

	public int getDbRowId() {
		return rowId;
	}

	public void setDbRowId(int rowId) {
		this.rowId = rowId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + rowId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Picture other = (Picture) obj;
		if (rowId != other.rowId)
			return false;
		return true;
	}

	public void success() {
		successesNumber++;
	}

	public void fail() {
		failsNumber++;
	}
}
